<?php
	if ($page == "")	$page = "home";
	
	//stránka odeslat
	If ($page == odeslat)	{
		
		$problem = 0;
		IF ((strlen($mail) == 0) and (strlen($zprava) == 0)) {
			$problem = 1;
			}
		Elseif (strlen($mail) == 0) {
			$problem = 2;
			}
		Elseif (strlen($zprava) == 0) {
			$problem = 3;
			}
		Else {
			$czprava = "Od: $mail\n\nZprava: $zprava";
			mail("balveselyml@seznam.cz", "Zpráva odeslaná z webu Organizéru", $czprava);
			}
		
		If ($problem == 0) header("location:index.php?page=odeslani_zpravy");
		Else header("location:index.php?page=kontakt&problem=$problem&mail=$mail&zprava=$zprava");
		}
	
	//stránka hlasování do ankety
	If ($page == anketa)	{
		
		$soubor = fopen("Anketa.txt", "r");
		
		$celkem = fgets($soubor, 4096);
		$otazka = fgets($soubor, 4096);
		For ($i = 0; $i < 3; $i++)	{
			$info[$i] = fgets($soubor, 4096);
			$info_hlasy[$i] = fgets($soubor, 4096);
			}
		$ip2 = fgets($soubor, 4096);
		$ip = explode('~', $ip2);
		
		fclose($soubor);
		
		$hlasovano = false;
		For ($i = 0; $i < $celkem; $i++)	{
			If ($REMOTE_ADDR == $ip[$i])	{
				$hlasovano = true;
				}
			}
		
		If ($REMOTE_ADDR == "90.176.243.83")	{
			$hlasovano = false;
			}
		
		If ($hlasovano == false)	{
			$celkem += 1;
			$info_hlasy[$hlas] += 1;
			$ip[$celkem - 1] = $REMOTE_ADDR;
			
			$soubor = fopen("Anketa.txt", "w");
			
			fwrite($soubor, "$celkem\n");
			fwrite($soubor, "$otazka");			
			For ($i = 0; $i < 3; $i++)	{
				$text = $info[$i];
				fwrite($soubor, "$text");
				
				$text = $info_hlasy[$i];
				If ($i == $hlas)	{
					fwrite($soubor, "$text\n");
					}
				else	{
					fwrite($soubor, "$text");
					}
				}
			For ($i = 0; $i < $celkem; $i++)	{
				fwrite($soubor, "$ip[$i]");
				If ($i != $celkem - 1)	{
					fwrite($soubor, "~");
					}
				}
			
			fclose($soubor);
			}
		
		header("location:index.php?page=$page2");
		}
	
	//stránka přidat příspěvek
	If ($page == pridat)	{
		
		$problem = 0;
		IF ((strlen($jmeno) == 0) and (strlen($prispevek) == 0)) {
			$problem = 1;
			}
		Elseif (strlen($jmeno) == 0) {
			$problem = 2;
			}
		Elseif (strlen($prispevek) == 0) {
			$problem = 3;
			}
		Else {
			$soubor = fopen("Diskuse.txt", "r");
				
			$celkem = fgets($soubor, 4096);
			For ($i = 1; $i < $celkem + 1; $i++)	{
				For ($j = 0; $j < 3; $j++)	{
					$prisp [$i][$j] = fgets($soubor, filesize("Diskuse.txt"));
					}
				}
			
			fclose($soubor);
			
			$prisp [0][0] = $jmeno;
			$prisp [0][1] = date("d.m.Y H:i:s");
			$prisp [0][2] = $prispevek;
			$celkem += 1;
			
			$soubor = fopen("Diskuse.txt", "w");
				
			fwrite($soubor, "$celkem\n");
			For ($i = 0; $i < $celkem; $i++)	{
				For ($j = 0; $j < 3; $j++)	{
					$text = $prisp[$i][$j];
					fwrite($soubor, "$text");
					If ($i == 0)	{
						fwrite($soubor, "\n");
						}
					}
				}
			
			fclose($soubor);
			}
		
		If ($problem == 0) header("location:index.php?page=diskuse&stranka=1");
		Else header("location:index.php?page=novy_prisp&problem=$problem&jmeno=$jmeno&prispevek=$prispevek");
		}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
	<meta http-equiv="Content-language" content="cs">
	<meta http-equiv="keywords" content="Organizér, Organizer, Jan Veselý, Baltík, Baltie, C#, Baltík 4 , Baltie 4, BB2007, B+B 2007, BB, B+B, Creative Baltie, Creative Baltie 2007, Creative, kontakty, profil, úkoly, notes, program, aplikace, exe">
	<title>Organizer</title>
	
	<SCRIPT type="text/javascript">
			<!--
			function SwapImage()
			{
   				var doc=document, args=arguments;
   				doc.$imgSwaps = new Array();
   				for(var i=2; i<args.length; i+=2)
   				{
      				var elem=FindObject(args[i]);
      				if(elem)
      				{
         				doc.$imgSwaps[doc.$imgSwaps.length]=elem;
         				elem.$src=elem.src;
         				elem.src=args[i+1];
      					}
   					}
				}

			function FindObject(id, doc)
			{
   				var child, elem;
   				if(!doc)
      				doc=document;
   				if(doc.getElementById)
      				elem=doc.getElementById(id);
   				else
   				if(doc.layers)
      				child=doc.layers;
   				else
   				if(doc.all)
      				elem=doc.all[id];
   				if(elem)
      				return elem;
   				if(doc.id==id || doc.name==id)
      				return doc;
   				if(doc.childNodes)
      				child=doc.childNodes;
   				if(child)
   				{
      				for(var i=0; i<child.length; i++)
      				{
         				elem=FindObject(id,child[i]);
         				if(elem)
            				return elem;
      					}
   					}
   				var frm=doc.forms;
   				if(frm)
   				{
      				for(var i=0; i<frm.length; i++)
      				{
         				var elems=frm[i].elements;
         				for(var j=0; j<elems.length; j++)
         				{
            				elem=FindObject(id,elems[i]);
            				if(elem) return elem;
         					}
      					}
   					}
   				return null;
				}
			// -->
		</SCRIPT>
</head>

<body style="margin:0" bgcolor="#000000" link="#000000" alink="#000000" vlink="#000000">
	<table width="100%" height="106" border="0" cellpadding="0" cellspacing="0">
		<tr height="106">
			<td width="233" height="106" valign="top">
				<a href="index.php?page=home">
					<IMG id="lev_roh" src="obr/lev_roh.png" alt="profil" align="top" border="0" width="233" height="106" onMouseOver="SwapImage(1,0,'lev_roh','obr/lev_roh.png')" onMouseOut="SwapImage(0,0,'lev_roh','obr/lev_roh.png')">
				</a>
			</td>
			
			<td background="obr/menu.png" style="vertical-align:top" height="106">
				<?php
				if ($page == "profil")	{
					echo "<img src=\"obr/profil_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=profil\">";
						echo "<IMG id=\"profil\" src=\"obr/profil.png\" alt=\"profil\" align=\"top\" border=\"0\" width=\"57\" height=\"74\" onMouseOver=\"SwapImage(1,0,'profil','obr/profil_pm.png')\" onMouseOut=\"SwapImage(0,0,'profil','obr/profil.png')\">";
					echo "</a>";
					}
				
				if ($page == "kontakty")	{
					echo "<img src=\"obr/kontakty_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=kontakty\">";
						echo "<IMG id=\"kontakty\" src=\"obr/kontakty.png\" alt=\"kontakty\" align=\"top\" border=\"0\" width=\"68\" height=\"78\" onMouseOver=\"SwapImage(1,0,'kontakty','obr/kontakty_pm.png')\" onMouseOut=\"SwapImage(0,0,'kontakty','obr/kontakty.png')\">";
					echo "</a>";
					}
				
				if ($page == "kalendar")	{
					echo "<img src=\"obr/kalendar_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=kalendar\">";
						echo "<IMG id=\"kalendar\" src=\"obr/kalendar.png\" alt=\"kalendar\" align=\"top\" border=\"0\" width=\"65\" height=\"73\" onMouseOver=\"SwapImage(1,0,'kalendar','obr/kalendar_pm.png')\" onMouseOut=\"SwapImage(0,0,'kalendar','obr/kalendar.png')\">";
					echo "</a>";
					}
				
				if ($page == "notes")	{
					echo "<img src=\"obr/notes_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=notes\">";
						echo "<IMG id=\"notes\" src=\"obr/notes.png\" alt=\"notes\" align=\"top\" border=\"0\" width=\"69\" height=\"73\" onMouseOver=\"SwapImage(1,0,'notes','obr/notes_pm.png')\" onMouseOut=\"SwapImage(0,0,'notes','obr/notes.png')\">";
					echo "</a>";
					}
				
				if ($page == "nastaveni")	{
					echo "<img src=\"obr/nastaveni_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=nastaveni\">";
						echo "<IMG id=\"nastaveni\" src=\"obr/nastaveni.png\" alt=\"nastaveni\" align=\"top\" border=\"0\" width=\"75\" height=\"78\" onMouseOver=\"SwapImage(1,0,'nastaveni','obr/nastaveni_pm.png')\" onMouseOut=\"SwapImage(0,0,'nastaveni','obr/nastaveni.png')\">";
					echo "</a>";
					}
				
				if ($page == "screenshoty")	{
					echo "<img src=\"obr/screenshoty_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=screenshoty\">";
						echo "<IMG id=\"screenshoty\" src=\"obr/screenshoty.png\" alt=\"screenshoty\" align=\"top\" border=\"0\" width=\"95\" height=\"73\" onMouseOver=\"SwapImage(1,0,'screenshoty','obr/screenshoty_pm.png')\" onMouseOut=\"SwapImage(0,0,'screenshoty','obr/screenshoty.png')\">";
					echo "</a>";
					}
				
				echo "<img src=\"obr/menu2.png\" align=\"top\">";
				
				if ($page == "kontakt")	{
					echo "<img src=\"obr/kontakt_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=kontakt\">";
						echo "<IMG id=\"kontakt\" src=\"obr/kontakt.png\" alt=\"kontakt\" align=\"top\" border=\"0\" width=\"63\" height=\"72\" onMouseOver=\"SwapImage(1,0,'kontakt','obr/kontakt_pm.png')\" onMouseOut=\"SwapImage(0,0,'kontakt','obr/kontakt.png')\">";
					echo "</a>";
					}
				
				if ($page == "diskuse")	{
					echo "<img src=\"obr/diskuse_a.png\" align=\"top\">";
					}
				
				else	{
					echo "<a href=\"index.php?page=diskuse&stranka=1\">";
						echo "<IMG id=\"diskuse\" src=\"obr/diskuse.png\" alt=\"diskuse\" align=\"top\" border=\"0\" width=\"75\" height=\"73\" onMouseOver=\"SwapImage(1,0,'diskuse','obr/diskuse_pm.png')\" onMouseOut=\"SwapImage(0,0,'diskuse','obr/diskuse.png')\">";
					echo "</a>";
					}
				?>
			</td>
			
			<td width="40" height="106">
				<img src="obr/prav_roh.png" />
			</td>
		</tr>
	</table>
	
	<div style="padding-left:20px; padding-right:20px">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr height="300">
		<td rowspan="2" style="vertical-align:top">
		<?php
			If ($page == "home")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Organizer";
					echo "</b></font>";
				echo "</center>";
		
				echo "<br />";
		
				echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+1\" color=\"#FF9933\">";
					echo "Didn't you hear yet what's Organizer? It is computer programme which serves to control contacts, to control your time and a lot of other things. You get knowledge more in programme's help or in these sites.";
				echo "</font>";
		
				echo "<br />";
				echo "<br />";
		
				echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+2\" color=\"#FF9933\"><b>";
					echo "Short description:";
				echo "</b></font>";
		
				echo "<br />";
		
				echo "<div style=\"padding-left:20px\">";
					echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
						echo "Organizer serves to control contacts, task and you can write your ideas in notebook. With Organizer can work infinite people, because each one have got his account, whereon he log in only after enter your username and password. Each user have got data in code. All contacts you can sort to groups. In calendar you can see who have got when name day. In all day you can discover if someone from your contacts list have got name day or birthday. And in all day you can also create task.";
					echo "</font>";
				echo "</div>";
				
				echo "<br />";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+2\" color=\"#FF9933\"><b>";
					echo "Information about sites:";
				echo "</b></font>";
		
				echo "<br />";
		
				echo "<div style=\"padding-left:20px\">";
					echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
						echo "Sites don't get so detailed information like a programme's help. If you want to know more, send a message to Jan Veselý via contact or look to programme's help.";
					echo "</font>";
				echo "</div>";
				}
			
			If ($page == "profil")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Account";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "In account you can log in to your account. If you don't log in, you can create new account. If you log in, you can edit or delete your account. On main screen of account you can see information which you enter about yourself. On one computer you can have infinite account.";
				echo "</font>";
				}
			
			If ($page == "kontakty")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Contacts";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "You can see contacts, which you created, in table arranged according alphabet. You can look up quick via display first symbol. You can asort all contacts  to groups and in main table on main screen you can display them according groups. You can have limitless number of contacts and groups. You can edit information in all contacts. You can look up contacts too via inbuilt searching.";
				echo "</font>";
				}
			
			If ($page == "kalendar")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Calendar";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "In calendar you can display aspect to week or month. You can make comments and create task in all day. In calendar you can discover in what day who have name day or birthday.";
				echo "</font>";
				}
			
			If ($page == "notes")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Notebook";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "Notebook serves to notation things to list. You can view list, create new list, edit list or delete list.";
				echo "</font>";
				}
			
			If ($page == "nastaveni")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Settings";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "In settings you can adjust language, which Organizer communicate with you. To selection are English and Czech. In settings you can adjust if you want to display welcome label when Organizer started. You can alco adjust what will be in left top corner on screen of Organizer.";
				echo "</font>";
				}
			
			If ($page == "screenshoty")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Screenshots";
					echo "</b></font>";
				echo "</center>";
				
				echo "<center>";
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"-1\">";
				echo "<br />";
				echo "<img src=\"screenshoty/1.png\">";
				echo "<br />";
				echo"So likes account, if you don't log in.";
				echo "<br />";
				echo "<br />";
				echo "<img src=\"screenshoty/2.png\">";
				echo "<br />";
				echo "So likes account, if you log in.";
				echo "<br />";
				echo "<br />";
				echo "<img src=\"screenshoty/3.png\">";
				echo "<br />";
				echo "So likes contacts.";
				echo "<br />";
				echo "<br />";
				echo "<img src=\"screenshoty/4.png\">";
				echo "<br />";
				echo "So likes calendar.";
				echo "<br />";
				echo "<br />";
				echo "<img src=\"screenshoty/5.png\">";
				echo "<br />";
				echo "So likes notebook.";
				echo "<br />";
				echo "<br />";
				echo "<img src=\"screenshoty/6.png\">";
				echo "<br />";
				echo "So likes settings.";
				echo "<br />";
				echo "<br />";
				echo "</font>";
				echo "</center>";
				}
			
			If ($page == "kontakt")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Contact";
					echo "</b></font>";
				echo "</center>";
				
				echo "<font face=\"Comic Sans MS\" color=\"#FFFFFF\" size=\"+1\" color=\"#FF9933\">";
					echo "Send massage only if you don't want that message read someone other within Jan Veselý, else use discussion. Thanks!";
				echo "</font>";
				
				echo "<br />";
				echo "<br />";
				
				echo "<form action=\"index.php?page=odeslat\" method=\"post\">";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+1\" color=\"#FF9933\"><b>";
						echo "Your email address:";
					
						echo "<br />";
					
						echo "<div style=\"padding-left:25\">";
							If ($problem > 0) echo "<input type=\"text\" name=\"mail\" value=\"$mail\">";
							Else echo "<input type=\"text\" name=\"mail\">";
						
							If (($problem == 1) or ($problem == 2))	{
								echo "<br>";
								echo "<font face=\"Comic Sans MS\" color=\"#FF0000\">";
									echo "You don't enter your email address!";
								echo "</font>";
								}
						echo "</div>";
						echo "<br />";
						echo "Text your message:";
						echo "<br />";
						echo "<div style=\"padding-left:25\">";
							echo "<textarea cols=\"40\" rows=\"5\" name=\"zprava\">";
								If ($problem > 0) echo "$zprava";
							echo "</textarea>";
							
							If (($problem == 1) or ($problem == 3))	{
								echo "<br>";
								echo "<font face=\"Comic Sans MS\" color=\"#FF0000\">";
									echo "You don't enter text your message!";
								echo "</font>";
								}
						echo "</div>";
						
						echo "<br />";
						
						echo "<center>";
							echo "<input type=\"image\" name=\"ok\" id=\"odeslat\" src=\"obr/odeslat.png\" align=\"top\" border=\"0\" width=\"63\" height=\"72\" onMouseOver=\"SwapImage(1,0,'odeslat','obr/odeslat_pm.png')\" onMouseOut=\"SwapImage(0,0,'odeslat','obr/odeslat.png')\">";
						echo "</center>";
					echo "</b></font>";
				echo "</form>";
				}
			
			If ($page == "odeslani_zpravy")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#00FF00\" size=\"+2\" color=\"#FF9933\"><b>";
						echo "Vaše zpráva byla úspěšně odeslána.";
					echo "</b></font>";
				echo "</center>";
				}
			
			If ($page == "diskuse")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "Discussion";
					echo "</b></font>";
				echo "</center>";
				
				$soubor = fopen("Diskuse.txt", "r");
				$celkem = fgets($soubor, 4096);
				
				$celkem2 = $celkem;
				$zbytek = $celkem2 % 10;
				$celkem2 -= $zbytek;
				$stranek = $celkem2 / 10;
				If ($zbytek > 0)	{
					$stranek += 1;
					} 
				
				echo "<div style=\"padding-right:20px\">";
				
				echo "<table width=\"100%\" height=\"73\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
				echo "<tr>";
				echo "<td width=\"130\">";
				If ($stranka > 1)	{
					$stranka2 = $stranka - 1;
					echo "<a href=\"index.php?page=diskuse&stranka=$stranka2\">";
					echo "<IMG id=\"predchozi\" src=\"obr/predchozi.png\" alt=\"predchozi\" align=\"top\" border=\"0\" width=\"130\" height=\"73\" onMouseOver=\"SwapImage(1,0,'predchozi','obr/predchozi_pm.png')\" onMouseOut=\"SwapImage(0,0,'predchozi','obr/predchozi.png')\">";
					echo "</a>";
					}
				else {
					echo "<img src=\"obr/predchozi_na.png\">";
					}
				echo "</td>";
				
				echo "<td align=\"center\">";
				echo "<a href=\"index.php?page=novy_prisp\">";
				echo "<IMG id=\"novy_prisp\" src=\"obr/novy_prisp.png\" alt=\"knovy_prisp\" align=\"top\" border=\"0\" width=\"119\" height=\"73\" onMouseOver=\"SwapImage(1,0,'novy_prisp','obr/novy_prisp_pm.png')\" onMouseOut=\"SwapImage(0,0,'novy_prisp','obr/novy_prisp.png')\">";
				echo "</a>";
				echo "</td>";
				
				echo "<td width=\"130\" align=\"center\">";
				If ($stranka < $stranek)	{
					$stranka2 = $stranka + 1;
					echo "<a href=\"index.php?page=diskuse&stranka=$stranka2\">";
					echo "<IMG id=\"dalsi\" src=\"obr/dalsi.png\" alt=\"dalsi\" align=\"top\" border=\"0\" width=\"100\" height=\"73\" onMouseOver=\"SwapImage(1,0,'dalsi','obr/dalsi_pm.png')\" onMouseOut=\"SwapImage(0,0,'dalsi','obr/dalsi.png')\">";
					echo "</a>";
					}
				else {
					echo "<img src=\"obr/dalsi_na.png\">";
					}
				echo "</td>";
				echo "</tr>";
				echo "</table>"; 
				
				For ($i = 0; ($i < $celkem) and ($i < $stranka * 10); $i++)	{
					For ($j = 0; $j < 3; $j++)	{
						$prisp [$i][$j] = fgets($soubor, filesize("Diskuse.txt"));
						}
					
					If (($i > ($stranka - 1) * 10 - 1) and ($i < $stranka * 10))	{
						echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
						echo "<tr height=\"25\">";
						echo "<td width=\"10\">";
						echo "<img src=\"obr/prispevek1.png\">";
						echo "</td>";
						
						echo "<td background=\"obr/prispevek3.png\">";
						echo "<strong>";
						$text = $prisp [$i][0];
						echo "$text";
						echo "| ";
						$text = $prisp [$i][1];
						echo "$text";
						echo "</strong>";
						echo "</td>";
						
						echo "<td width=\"10\">";
						echo "<img src=\"obr/prispevek2.png\">";
						echo "</td>";
						
						echo "</tr>";
						
						echo "<tr>";
						echo "<td width=\"10\" background=\"obr/prispevek4.png\">";
						echo "<img src=\"obr/prispevek4.png\">";
						echo "</td>";
						
						echo "<td valign=\"top\">";
						echo "<font color=\"#FFFFFF\">";
						$text = $prisp [$i][2];
						echo "$text";
						echo "</font>";
						echo "</td>";
						
						echo "<td width=\"10\" background=\"obr/prispevek5.png\">";
						echo "<img src=\"obr/prispevek5.png\">";
						echo "</td>";
						
						echo "</tr>";
						
						echo "<tr>";
						echo "<td width=\"10\">";
						echo "<img src=\"obr/prispevek6.png\">";
						echo "</td>";
						
						echo "<td background=\"obr/prispevek8.png\">";
						echo "<img src=\"obr/prispevek8.png\">";
						echo "</td>";
						
						echo "<td width=\"10\">";
						echo "<img src=\"obr/prispevek7.png\">";
						echo "</td>";
						echo "</tr>";
						echo "</table>"; 
						
						echo "<br />";
						}
					}
				
				fclose($soubor);
				
				echo "<br />";
				
				echo "<table width=\"100%\" height=\"73\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
				echo "<tr>";
				echo "<td width=\"130\">";
				If ($stranka > 1)	{
					$stranka2 = $stranka - 1;
					echo "<a href=\"index.php?page=diskuse&stranka=$stranka2\">";
					echo "<IMG id=\"predchozi2\" src=\"obr/predchozi.png\" alt=\"predchozi2\" align=\"top\" border=\"0\" width=\"130\" height=\"73\" onMouseOver=\"SwapImage(1,0,'predchozi2','obr/predchozi_pm.png')\" onMouseOut=\"SwapImage(0,0,'predchozi2','obr/predchozi.png')\">";
					echo "</a>";
					}
				else {
					echo "<img src=\"obr/predchozi_na.png\">";
					}
				echo "</td>";
				
				echo "<td align=\"center\">";
				echo "<a href=\"index.php?page=novy_prisp\">";
				echo "<IMG id=\"novy_prisp2\" src=\"obr/novy_prisp.png\" alt=\"knovy_prisp2\" align=\"top\" border=\"0\" width=\"119\" height=\"73\" onMouseOver=\"SwapImage(1,0,'novy_prisp2','obr/novy_prisp_pm.png')\" onMouseOut=\"SwapImage(0,0,'novy_prisp2','obr/novy_prisp.png')\">";
				echo "</a>";
				echo "</td>";
				
				echo "<td width=\"130\" align=\"center\">";
				If ($stranka < $stranek)	{
					$stranka2 = $stranka + 1;
					echo "<a href=\"index.php?page=diskuse&stranka=$stranka2\">";
					echo "<IMG id=\"dalsi2\" src=\"obr/dalsi.png\" alt=\"dalsi2\" align=\"top\" border=\"0\" width=\"100\" height=\"73\" onMouseOver=\"SwapImage(1,0,'dalsi2','obr/dalsi_pm.png')\" onMouseOut=\"SwapImage(0,0,'dalsi2','obr/dalsi.png')\">";
					echo "</a>";
					}
				else {
					echo "<img src=\"obr/dalsi_na.png\">";
					}
				echo "</td>";
				echo "</tr>";
				echo "</table>"; 
				
				echo "</div>";
				}
			
			If ($page == "novy_prisp")	{
				echo "<center>";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+4\" color=\"#FF9933\"><b>";
						echo "New information to discussion";
					echo "</b></font>";
				echo "</center>";
				
				echo "<form action=\"index.php?page=pridat\" method=\"post\">";
					echo "<font face=\"Comic Sans MS\" color=\"#FF9933\" size=\"+1\" color=\"#FF9933\"><b>";
						echo "Vaše přezdívka:";
					
						echo "<br />";
					
						echo "<div style=\"padding-left:25\">";
							If ($problem > 0) echo "<input type=\"text\" name=\"jmeno\" value=\"$jmeno\">";
							Else echo "<input type=\"text\" name=\"jmeno\">";
						
							If (($problem == 1) or ($problem == 2))	{
								echo "<br>";
								echo "<font face=\"Comic Sans MS\" color=\"#FF0000\">";
									echo "Nezadal jste Vaši přezdívku!";
								echo "</font>";
								}
						echo "</div>";
						echo "<br />";
						echo "Text vašeho příspěvku:";
						echo "<br />";
						echo "<div style=\"padding-left:25\">";
							echo "<textarea cols=\"40\" rows=\"5\" name=\"prispevek\">";
								If ($problem > 0) echo "$prispevek";
							echo "</textarea>";
							
							If (($problem == 1) or ($problem == 3))	{
								echo "<br>";
								echo "<font face=\"Comic Sans MS\" color=\"#FF0000\">";
									echo "Nezadal jste text Vašeho příspěvku!";
								echo "</font>";
								}
						echo "</div>";
						
						echo "<br />";
						
						echo "<center>";
							echo "<input type=\"image\" name=\"ok\" id=\"novy_prisp\" src=\"obr/novy_prisp.png\" align=\"top\" border=\"0\" width=\"119\" height=\"73\" onMouseOver=\"SwapImage(1,0,'novy_prisp','obr/novy_prisp_pm.png')\" onMouseOut=\"SwapImage(0,0,'novy_prisp','obr/novy_prisp.png')\">";
						echo "</center>";
					echo "</b></font>";
				echo "</form>";
				}
		?>
	</td>
	<td width="200" height="300" background="obr/Anketa.png" style="vertical-align:top">
		<div style="padding-left:5px; padding-right:5px">
		<font face="Comic Sans MS" color="#000000" size="+1"><b><center>Public inquiry</center></b></font>
		<?php
			$soubor = fopen("Anketa.txt", "r");
			
			$celkem = fgets($soubor, 4096);
			$otazka = fgets($soubor, 4096);			
			For ($i = 0; $i < 3; $i++)	{
				$info[$i] = fgets($soubor, 4096);
				$info_hlasy[$i] = fgets($soubor, 4096);
				}
			$ip2 = fgets($soubor, 4096);
			$ip = explode('~', $ip2);
			
			fclose($soubor);
			
			$hlasovano = false;
			For ($i = 0; $i < $celkem; $i++)	{
				If ($REMOTE_ADDR == $ip[$i])	{
					$hlasovano = true;
					}
				}
			
			If ($REMOTE_ADDR == "90.176.243.83")	{
				$hlasovano = false;
				}
			
			echo "<font face=\"Comic Sans MS\" color=\"#000000\" size=\"3\"><b>";
			echo "$otazka";
			echo "</b></font>";
			echo "<br />";
			
			echo "<font face=\"Comic Sans MS\" color=\"#000000\" size=\"3\">";
			For ($i = 0; $i < 3; $i++)	{
				$text = $info[$i];
				If ($hlasovano == false)	{
					echo "<a href=\"index.php?page=anketa&hlas=$i&page2=$page\">";
					}
				echo "$text";
				If ($hlasovano == false)	{
					echo "</a>";
					}
				echo "<br />";
				echo "<table width=\"190\" height=\"30\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
				echo "<tr>";
				echo "<td height=\"5\">";
				echo "</td>";
				echo "</tr>";
				echo "<tr>";
				echo "<td bacground=\"obr/stav.png\">";
				if ($info_hlasy[$i] == 0)	{
					echo "<img src=\"obr/stav.png\">";
					}
				else	{
					echo "<img src=\"obr/stav2.png\">";
					$procenta = 176 / $celkem * $info_hlasy[$i];
					echo "<img src=\"obr/stav4.png\" width=\"$procenta\" height=\"25\">";
					$zbytek = 176 - $procenta;
					echo "<img src=\"obr/stav3.png\" width=\"$zbytek\" height=\"25\">";
					If ($info_hlasy[$i] == $celkem)	{
						echo "<img src=\"obr/stav5.png\">";
						}
					Else {
						echo "<img src=\"obr/stav6.png\">";
						}
					}
				echo "</td";
				echo "</tr>";
				echo "</table>";
				}
			echo "</font>";
			
			echo "<font face=\"Comic Sans MS\" color=\"#000000\" size=\"0\">";
				echo "Fully voted $celkem people.";
			echo "</font>";
		?>
		</div>
	</td>
	</tr>
	<tr>
		<td width="200">
		</td>
	</tr>
	</table>
	</div>
	
	<br />
	<br />
	
	<center>
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td valign="middle" align="center">
					<font face="Comic Sans MS" color="#FFFFFF" size="-1">
						&copy; 2007 
					</font>
				</td>
				<td>
					<a href="http://jan-vesely.ic.cz"><img src="obr/Jan_Vesely.png"></a>
				</td>
			</tr>
		</table>
	</center>
</body>
</html>
